package D1;

import java.util.Objects;

public class Java03 {
    public static void main(String[] args) {
        //Objects类：是一个工具类，不能被继承
        String s1 = null;
        String s2 = "itheima";
        //System.out.println(s1.equals(s2));
        System.out.println(Objects.equals(s1,s2));
        //判断对象是否为null，等价于==
        System.out.println(Objects.isNull(s1));
        System.out.println(s1==null);
        //判断对象是否不为null，等价于！=
        System.out.println(Objects.nonNull(s2));
        System.out.println(s2 != null);


    }
}
